<?php 
require_once 'UtilHtml.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
	<title>Registro de Usuario</title>
	<link rel="stylesheet" href="css/style_formularioFE.css" type="text/css" media="all" />
	<?php 
		jsValidator();
	?>
	<script>
    
	// This method is called right before the ajax form validation request
	// it is typically used to setup some visuals ("Please wait...");
	// you may return a false to stop the request 
	function beforeCall(form, options){
		if (window.console) 
		alert("Right before the AJAX form validation call");
		return true;
	}
        
	// Called once the server replies to the ajax form validation request
	function ajaxValidationCallback(status, form, json, options){
		if (window.console) 
		alert(status);
            
		if (status === true) {
			//alert("the form is valid!");
			// uncomment these lines to submit the form to form.action
			 form.validationEngine('detach');
			document.getElementById('seleccion').value='s';
			 form.submit();
			// or you may use AJAX again to submit the data
		}
	}
        
	jQuery(document).ready(function(){
		jQuery("#formID").validationEngine({
			ajaxFormValidation: true,
			ajaxFormValidationMethod: 'post',
			onAjaxFormComplete: ajaxValidationCallback
		});
	});
	
	</script>
	<style type="text/css">
	body
	{
		margin:0px;
		padding:0px;
		height: 300px;
		width: 700px;
	}
	</style>
</head>
<body>
	<center>
	<form id="formID"  method="post" action="registroNewUserSubmit.php" style="width:80%">
		
		<table border="0px" width="600px" class="cssTablaDatos" >
			<tr>
					<td colspan="2" class="separadorTitulos" >
						<p class="titulosExperienciaLaboral">Registro de Usuario</p>
			            <p class="subtitulos">(Ingrese su informaci&oacute;n personal).</p>
					</td>
				</tr>
			<tr>
				<td align="right">
					<span class="letras_form">Usuario: </span>
				</td>
				<td align="left">		
					<input type="hidden"  name="seleccion" id="seleccion"/>			
					<input value="" class="validate[required,custom[onlyLetterNumber],maxSize[20]] text-input" type="text" name="user" id="user" size="30" />
				</td>
			</tr>
			<tr>
				<td align="right">
					<span class="letras_form">Direcci&oacute;n de Correo: </span>
				</td>
				<td align="left">					
					<input value="" class="validate[required,custom[email]] text-input" type="text" name="email" id="email" size="30" />
				</td>
			</tr>
			<tr>
				<td align="right">
					<span class="letras_form">Password : </span>
				</td>
				<td align="left">					
					<input value="" class="validate[required] text-input" type="password" name="password" id="password" size="32" />
				</td>
			</tr>
			<tr>
				<td align="right">
					<span class="letras_form">Confirmar el password : </span>
				</td>
				<td align="left">
					<input value="" class="validate[required,equals[password]] text-input" type="password" name="password2" id="password2"  size="32" />	
				</td>
			</tr>
			<tr>
				<td align="center" colspan="2">
					<span class="subtitulos">Deseo recibir informaci&oacute;n de los productos y servicios por correo <input value="" type="checkbox" name="productos" id="productos"  size="32" /></span>
				</td>
				
			</tr>
		</table>
		<br/>
		<table width="40%">
		<tr>
		
			<td><input class="boton_form" type="submit" value="Guardar"/></td>
			
		</tr>	
		</table>
		
	</form>
	</center>
</body>
</html>
